/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Entities;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Cristian
 */
@Entity
@Table(name = "sciftbactplan")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Sciftbactplan.findAll", query = "SELECT s FROM Sciftbactplan s"),
    @NamedQuery(name = "Sciftbactplan.findBySciftbactplanid", query = "SELECT s FROM Sciftbactplan s WHERE s.sciftbactplanid = :sciftbactplanid"),
    @NamedQuery(name = "Sciftbactplan.findByActividad", query = "SELECT s FROM Sciftbactplan s WHERE s.actividad = :actividad"),
    @NamedQuery(name = "Sciftbactplan.findByMeta", query = "SELECT s FROM Sciftbactplan s WHERE s.meta = :meta"),
    @NamedQuery(name = "Sciftbactplan.findBySem1", query = "SELECT s FROM Sciftbactplan s WHERE s.sem1 = :sem1"),
    @NamedQuery(name = "Sciftbactplan.findBySem2", query = "SELECT s FROM Sciftbactplan s WHERE s.sem2 = :sem2"),
    @NamedQuery(name = "Sciftbactplan.findBySem3", query = "SELECT s FROM Sciftbactplan s WHERE s.sem3 = :sem3"),
    @NamedQuery(name = "Sciftbactplan.findBySem4", query = "SELECT s FROM Sciftbactplan s WHERE s.sem4 = :sem4"),
    @NamedQuery(name = "Sciftbactplan.findByComentario", query = "SELECT s FROM Sciftbactplan s WHERE s.comentario = :comentario"),
    @NamedQuery(name = "Sciftbactplan.findByPrioridad", query = "SELECT s FROM Sciftbactplan s WHERE s.prioridad = :prioridad"),
    @NamedQuery(name = "Sciftbactplan.findByFecharegistro", query = "SELECT s FROM Sciftbactplan s WHERE s.fecharegistro = :fecharegistro"),
    @NamedQuery(name = "Sciftbactplan.findByObservaciones", query = "SELECT s FROM Sciftbactplan s WHERE s.observaciones = :observaciones")})
public class Sciftbactplan implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "sciftbactplanid")
    private Integer sciftbactplanid;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "actividad")
    private String actividad;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 500)
    @Column(name = "meta")
    private String meta;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sem1")
    private double sem1;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sem2")
    private double sem2;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sem3")
    private double sem3;
    @Basic(optional = false)
    @NotNull
    @Column(name = "sem4")
    private double sem4;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 300)
    @Column(name = "comentario")
    private String comentario;
    @Basic(optional = false)
    @NotNull
    @Column(name = "prioridad")
    private int prioridad;
    @Basic(optional = false)
    @NotNull
    @Column(name = "fecharegistro")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fecharegistro;
    @Size(max = 255)
    @Column(name = "observaciones")
    private String observaciones;
    @JoinColumn(name = "sciftbplandocid", referencedColumnName = "sciftbplandocid")
    @ManyToOne(optional = false)
    private Sciftbplandoc sciftbplandocid;
    @JoinColumn(name = "scaltblineinveid", referencedColumnName = "scaltblineinveid")
    @ManyToOne(optional = false)
    private Scaltblineinve scaltblineinveid;
    @JoinColumn(name = "pytctbactcompid", referencedColumnName = "pytctbactcompid")
    @ManyToOne(optional = false)
    private Pytctbactcomp pytctbactcompid;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "sciftbactplanid")
    private Collection<Sciftbactinfdo> sciftbactinfdoCollection;

    public Sciftbactplan() {
    }

    public Sciftbactplan(Integer sciftbactplanid) {
        this.sciftbactplanid = sciftbactplanid;
    }

    public Sciftbactplan(Integer sciftbactplanid, String actividad, String meta, double sem1, double sem2, double sem3, double sem4, String comentario, int prioridad, Date fecharegistro) {
        this.sciftbactplanid = sciftbactplanid;
        this.actividad = actividad;
        this.meta = meta;
        this.sem1 = sem1;
        this.sem2 = sem2;
        this.sem3 = sem3;
        this.sem4 = sem4;
        this.comentario = comentario;
        this.prioridad = prioridad;
        this.fecharegistro = fecharegistro;
    }

    public Integer getSciftbactplanid() {
        return sciftbactplanid;
    }

    public void setSciftbactplanid(Integer sciftbactplanid) {
        this.sciftbactplanid = sciftbactplanid;
    }

    public String getActividad() {
        return actividad;
    }

    public void setActividad(String actividad) {
        this.actividad = actividad;
    }

    public String getMeta() {
        return meta;
    }

    public void setMeta(String meta) {
        this.meta = meta;
    }

    public double getSem1() {
        return sem1;
    }

    public void setSem1(double sem1) {
        this.sem1 = sem1;
    }

    public double getSem2() {
        return sem2;
    }

    public void setSem2(double sem2) {
        this.sem2 = sem2;
    }

    public double getSem3() {
        return sem3;
    }

    public void setSem3(double sem3) {
        this.sem3 = sem3;
    }

    public double getSem4() {
        return sem4;
    }

    public void setSem4(double sem4) {
        this.sem4 = sem4;
    }

    public String getComentario() {
        return comentario;
    }

    public void setComentario(String comentario) {
        this.comentario = comentario;
    }

    public int getPrioridad() {
        return prioridad;
    }

    public void setPrioridad(int prioridad) {
        this.prioridad = prioridad;
    }

    public Date getFecharegistro() {
        return fecharegistro;
    }

    public void setFecharegistro(Date fecharegistro) {
        this.fecharegistro = fecharegistro;
    }

    public String getObservaciones() {
        return observaciones;
    }

    public void setObservaciones(String observaciones) {
        this.observaciones = observaciones;
    }

    public Sciftbplandoc getSciftbplandocid() {
        return sciftbplandocid;
    }

    public void setSciftbplandocid(Sciftbplandoc sciftbplandocid) {
        this.sciftbplandocid = sciftbplandocid;
    }

    public Scaltblineinve getScaltblineinveid() {
        return scaltblineinveid;
    }

    public void setScaltblineinveid(Scaltblineinve scaltblineinveid) {
        this.scaltblineinveid = scaltblineinveid;
    }

    public Pytctbactcomp getPytctbactcompid() {
        return pytctbactcompid;
    }

    public void setPytctbactcompid(Pytctbactcomp pytctbactcompid) {
        this.pytctbactcompid = pytctbactcompid;
    }

    @XmlTransient
    public Collection<Sciftbactinfdo> getSciftbactinfdoCollection() {
        return sciftbactinfdoCollection;
    }

    public void setSciftbactinfdoCollection(Collection<Sciftbactinfdo> sciftbactinfdoCollection) {
        this.sciftbactinfdoCollection = sciftbactinfdoCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (sciftbactplanid != null ? sciftbactplanid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Sciftbactplan)) {
            return false;
        }
        Sciftbactplan other = (Sciftbactplan) object;
        if ((this.sciftbactplanid == null && other.sciftbactplanid != null) || (this.sciftbactplanid != null && !this.sciftbactplanid.equals(other.sciftbactplanid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Entities.Sciftbactplan[ sciftbactplanid=" + sciftbactplanid + " ]";
    }
    
}
